checkStringNotEmpty
Ensures that an string reference passed as a parameter to the calling method is not empty.
Return
the string reference that was validated
Parameters
string
an string reference
Throws
if string
is empty
open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: T, @NonNull errorMessage: Any): T(source)
Ensures that an string reference passed as a parameter to the calling method is not empty.
Return
the string reference that was validated
Parameters
string
an string reference
errorMessage
the exception message to use if the check fails; will be converted to a string using valueOf
Throws
if string
is empty
open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: T, @NonNull messageTemplate: String, @NonNull messageArgs: Array<Any>): T(source)
Ensures that an string reference passed as a parameter to the calling method is not empty.
Return
the string reference that was validated
Parameters
string
an string reference
messageTemplate
a printf-style message template to use if the check fails; will be converted to a string using format
messageArgs
arguments for messageTemplate
Throws
if string
is empty